/* ITG3200 Example

This is an example of using the ITG3200 object library

Typing any key outputs the gyro data

*/

#include <Wire.h>;
#include <ITG3200.h>

ITG3200 gyro;

int x_rate;
int y_rate;
int z_rate;


void setup() {
  // Join I2C Bus
  Wire.begin();
  // Initialize serial communication 
  Serial.begin(9600);
  // Initialize the gyro
  gyro.begin();
}

void loop() {
  
  if (Serial.available()) {
    char inByte = Serial.read();
    gyro.get_rates(&x_rate, &y_rate, &z_rate);
    Serial.print(x_rate);
    Serial.print(", ");
    Serial.print(y_rate);
    Serial.print(", ");
    Serial.println(z_rate);
  }
}
